<!DOCTYPE html>
<%@page contentType="text/html;charset=UTF-8" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="/tld/authority.tld" prefix="authority" %>
<%@taglib uri="/tld/token.tld" prefix="token" %>
<div>
    <style>
        .panel-add-to{
            padding:0 10px 20px;
        }
        .popup5 .panel-body-ws{
            padding:10px 0;
        }
        .attrVal-node-add{
            line-height:34px;
        }
        .controlX{
            width:44%;
            padding:3px;
            margin-bottom:2px;
            height:26px;
            display:inline;
        }
        .attrVal-content{
            width:376px;
            height:406px;
            overflow-y:auto;
        }
        .no-border{
            border:0;
        }
    </style>

    <div class="pop-background">
        <div class="col-md-4">
            <div class="popup popup5 popup-small x-4-move">
                <div class="panel-heading">
                    <div class="panel-btns">
                        <a class="panel-close btn-4-hide">×</a>
                    </div>
                    <h3 class="panel-title">${empty attributeParamAlias.id ? '新增属性内容别名' : '修改属性内容别名'}</h3>
                </div>
                <div class="panel-add-to">
                    <div class="row">
                        <form>
                            <token:token/>
                            <input type="hidden" name="id" value="${attributeParamAlias.id}" />
                            <input type="hidden" name="paramData" value='${attributeParamAlias.paramData}' />
                            <input type="hidden" name="seq" value="${attributeParamAlias.seq}" />
                            <input type="hidden" name="categoryId" value="${attributeParamAlias.categoryId}" />
                            <input type="hidden" name="level" value="${attributeParamAlias.level}" />
                            <input type="hidden" name="datas" value="" />
                            <div class="panel-body panel-body-ws">
                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">类别：</label>

                                        <div class="col-sm-6">

                                            <c:choose>
                                                <c:when test="${empty attributeParamAlias.id}">

                                                    <div class="select-container select" style="width:39%">
                                                        <select class="select select-offscreen Lv1" name="levelOne">
                                                            <option value="">-请选择-</option>
                                                            <c:forEach items="${levelOneList}" var="item">
                                                                <option value="${item.id}" ${item.id == levelOne.id ? 'selected' : ''}>${item.name}</option>
                                                            </c:forEach>
                                                        </select>
                                                    </div>

                                                    <div class="select-container select" style="width:60%">
                                                        <select class="select select-offscreen Lv2" name="levelTwo">
                                                            <option value="">-请选择-</option>
                                                            <c:forEach items="${levelTwoList}" var="item">
                                                                <option value="${item.id}" ${item.id == levelTwo.id ? 'selected' : ''}>${item.name}</option>
                                                            </c:forEach>
                                                        </select>
                                                    </div>

                                                </c:when>
                                                <c:otherwise>
                                                    <%--
                                                    <input type="hidden" name="levelOne" value="${levelOne.id}" />
                                                    <input type="hidden" name="levelTwo" value="${levelTwo.id}" />
                                                    <label class="control-label">${empty levelOne.name?"~":levelOne.name} / ${empty levelTwo.name?"~":levelTwo.name}</label>
                                                    --%>


                                                    <div class="select-container select" style="width:39%">
                                                        <select class="select select-offscreen Lv1" name="levelOne">
                                                            <option value="">-请选择-</option>
                                                            <c:forEach items="${levelOneList}" var="item">
                                                                <option value="${item.id}" ${item.id == levelOne.id ? 'selected' : ''}>${item.name}</option>
                                                            </c:forEach>
                                                        </select>
                                                    </div>

                                                    <div class="select-container select" style="width:60%">
                                                        <select class="select select-offscreen Lv2" name="levelTwo">
                                                            <option value="">-请选择-</option>
                                                            <c:forEach items="${levelTwoList}" var="item">
                                                                <option value="${item.id}" ${item.id == levelTwo.id ? 'selected' : ''}>${item.name}</option>
                                                            </c:forEach>
                                                        </select>
                                                    </div>


                                                </c:otherwise>
                                            </c:choose>

                                        </div>
                                    </div>
                                </div>

                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">属性：</label>

                                        <div class="col-sm-6">
                                            <div class="select-container select">

                                                <c:choose>
                                                    <c:when test="${empty attributeParamAlias.id}">
                                                        <select class="select select-offscreen" name="name">
                                                            <option value="">-请选择-</option>
                                                            <c:forEach items="${attributeList}" var="item">
                                                                <option value="${item.name}" ${item.id == attributeParamAlias.id ? 'selected' : ''}>${item.name}</option>
                                                            </c:forEach>
                                                        </select>
                                                    </c:when>
                                                    <c:otherwise>
                                                        <input type="text" class="form-control no-border" name="name" value="${attributeParamAlias.name}" readonly />
                                                    </c:otherwise>
                                                </c:choose>

                                            </div>
                                        </div>
                                    </div>
                                </div>

                                <div class="col-md-6">
                                    <div class="form-group">
                                        <label class="col-sm-3 control-label">别名内容：</label>

                                        <div class="col-sm-6">
                                            <a class="attrVal-node-add">增加</a>
                                            <div>
                                                <input class="form-control controlX" value="别名名称" style="border:0;color:red;" disabled/>
                                                <input class="form-control controlX" value="排序" style="border:0;color:red;" disabled/>
                                            </div>
                                            <div class="attrVal-content">

                                                <c:forEach items="${paramDataList}" var="item">
                                                    <c:forEach items="${item.params}" var="ps" varStatus="vStatus">
                                                        <div>
                                                            <input type="text" class="form-control controlX" name="val" value="${ps}" o="${ps}" />
                                                            <input type="text" class="form-control controlX" name="seq" value="${vStatus.count}" />
                                                            <a class="attrVal-node-del">删除</a>
                                                        </div>
                                                    </c:forEach>
                                                </c:forEach>

                                            </div>
                                        </div>
                                    </div>
                                </div>

                            </div>
                        </form>
                    </div>

                    <div class="btn-group2-s">
                        <div class="panel-body panel-body2">
                            <div class="btn-group2 left">
                                <authority:authority url="/attrParam/add,/attrParam/modify">
                                    <button type="button" class="btn btn-primary btn-4-save">保存</button>
                                </authority:authority>
                                <button type="button" class="btn btn-default btn-4-hide">取消</button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <script src="js/dictionary/attr-param-alias-edit.js"></script>
    </div>
</div>